#!/usr/bin/python
#coding=utf-8

import sys, datetime, json, logging



from singleCost import *
from siresult.sicbResult import *
from siresult.extractSCALData import SACL
from bzbzcb import *
from bzbzfy import *
from bzcbjs import *
from bzsjcb_d import *
from writelog import *
if __name__ == '__main__':

    start = datetime.datetime.now()
    # p_day_1 = (start - datetime.timedelta(days=1)).strftime("%Y%m%tmp_dict")
    # p_day_2 = (start - datetime.timedelta(days=2)).strftime("%Y%m%tmp_dict")
    p_day_2 = '20220501'
    p_day_1 = '20220505'
    # p_month = start.strftime("%Y%m")
    # writelog('batchD.py', start, 'start', '')
    param_info = 'start,'

    # # # # 四期机组
    code = singeCost('1001', 'Q602', 'MIBH', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q602')
    # # if code == 1:
    # #     # sicbResult('Q602', p_day_1, p_day_2)
    # # if code == 0:
    # #     param_info = param_info + 'Q602_CODE=0,'
    code = singeCost('1001', 'Q512', 'MIJA', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q512')
    # # if code == 1:
    # #     # sicbResult('Q512', p_day_1, p_day_2)
    # # if code == 0:
    # #     param_info = param_info + 'Q512_CODE=0,'
    code = singeCost('1001', 'Q503', 'MIJC', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q503')
    # # if code == 1:
    # #     # sicbResult('Q503', p_day_1, p_day_2)
    # # if code == 0:
    # #     param_info = param_info + 'Q503_CODE=0,'
    code = singeCost('1001', 'Q414', 'MIJD', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q414')
    # # if code == 1:
    # #     # sicbResult('Q414', p_day_1, p_day_2)
    # # if code == 0:
    # #     param_info = param_info + 'Q414_CODE=0,'
    #
    # # # # 三期机组
    code = singeCost('1001', 'Q314', 'MIHF', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q314')

    # # if code == 1:
    # #     # sicbResult('Q314', p_day_1, p_day_2)
    # # if code == 0:
    # #     param_info = param_info + 'Q314_CODE=0,'
    code = singeCost('1001', 'Q412', 'MIHB', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q412')

    # # if code == 1:
    # #     # sicbResult('Q412', p_day_1, p_day_2)
    # # if code == 0:
    # #     param_info = param_info + 'Q412_CODE=0,'
    code = singeCost('1001', 'Q402', 'MIBD', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q402')

    # # if code == 1:
    # #     # sicbResult('Q402', p_day_1, p_day_2)
    # # if code == 0:
    # #     param_info = param_info + 'Q402_CODE=0,'
    code = singeCost('1001', 'Q502', 'MIBE', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q502')

    # # if code == 1:
    # #     # sicbResult('Q502', p_day_1, p_day_2)
    # # if code == 0:
    # #     param_info = param_info + 'Q502_CODE=0,'
    code = singeCost('1001', 'Q403', 'MIHD', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q403')

    # # if code == 1:
    # #     # sicbResult('Q403', p_day_1, p_day_2)
    # # if code == 0:
    # #     param_info = param_info + 'Q403_CODE=0,'
    #
    # # singeCost('1001', 'Q318', '', p_day_2 + '200000', p_day_1 + '200000', 'D')
    #
    # # singeCost('1001', 'Q181', '', p_day_2 + '200000', p_day_1 + '200000', 'D')
    #
    code = singeCost('1001', 'Q518', 'MIDE', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q518')
    # # if code == 1:
    # #     # sicbResult('Q518', p_day_1, p_day_2)
    # # if code == 0:
    # #     param_info = param_info + 'Q518_CODE=0,'
    # # singeCost('1001', 'Q518', 'MIDE', p_day_2 + '200000', p_day_1 + '200000', 'D')
    # # sicbResult('Q518', p_day_1, p_day_2)
    # code = singeCost('1001', 'Q161', 'MIDF', p_day_2 + '200000', p_day_1 + '200000', 'D')
    # print('Q161')
    # if code == 1:
    #     # sicbResult('Q161', p_day_1, p_day_2)
    # if code == 0:
    #     # param_info = param_info + 'Q161_CODE=0,'
    code = singeCost('1001', 'Q162', 'MIDG', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q162')
    # if code == 1:
    #     # sicbResult('Q162', p_day_1, p_day_2)
    # if code == 0:
    #     param_info = param_info + 'Q162_CODE=0,'
    code = singeCost('1001', 'Q163', 'MIDH', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q163')
    # if code == 1:
    #     # sicbResult('Q163', p_day_1, p_day_2)
    # else:
    # #     param_info = param_info + 'Q163_CODE=0,'
    code = singeCost('1001', 'Q165', 'MIDJ', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q165')
    # if code == 1:
    #     # sicbResult('Q165', p_day_1, p_day_2)
    # if code == 0:
    #     param_info = param_info + 'Q165_CODE=0,'
    code = singeCost('1001', 'Q173', 'MIHH', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q173')
    # if code == 1:
    #     # sicbResult('Q173', p_day_1, p_day_2)
    # if code == 0:
    #     param_info = param_info + 'Q173_CODE=0,'
    code = singeCost('1001', 'Q174', 'MICK', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q174')
    # if code == 1:
    #     # sicbResult('Q174', p_day_1, p_day_2)
    # if code == 0:
    #     param_info = param_info + 'QQ174_CODE=0,'
    code = singeCost('1001', 'Q175', 'MICL', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q175')
    # if code == 1:
    #     # sicbResult('Q175', p_day_1, p_day_2)
    # if code == 0:
    #     param_info = param_info + 'Q175_CODE=0,'

    # # # 二期机组
    code = singeCost('1001', 'Q114', 'MICE', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q114')

    # if code == 1:
    #     # sicbResult('Q114', p_day_1, p_day_2)
    # if code == 0:
    #     param_info = param_info + 'Q114_CODE=0,'
    code = singeCost('1001', 'Q214', 'MIHE', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q214')

    # if code == 1:
    #     # sicbResult('Q214', p_day_1, p_day_2)
    # if code == 0:
    #     param_info = param_info + 'Q214_CODE=0,'
    code = singeCost('1001', 'Q112', 'MICA', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q112')

    # if code == 1:
    #     # sicbResult('Q112', p_day_1, p_day_2)
    # if code == 0:
    #     param_info = param_info + 'Q112_CODE=0,'
    code = singeCost('1001', 'Q212', 'MICB', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q212')

    # if code == 1:
    #     # sicbResult('Q212', p_day_1, p_day_2)
    # if code == 0:
    #     param_info = param_info + 'Q212_CODE=0,'
    code = singeCost('1001', 'Q312', 'MIHA', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q312')

    # if code == 1:
    #     # sicbResult('Q312', p_day_1, p_day_2)
    # if code == 0:
    #     param_info = param_info + 'Q312_CODE=0,'
    code = singeCost('1001', 'Q103', 'MICC', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q103')

    # if code == 1:
    #     sicbResult('Q103', p_day_1, p_day_2)
    # if code == 0:
    #     param_info = param_info + 'Q103_CODE=0,'
    code = singeCost('1001', 'Q203', 'MICD', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q203')

    # if code == 1:
    #     sicbResult('Q203', p_day_1, p_day_2)
    # if code == 0:
    #     param_info = param_info + 'Q203_CODE=0,'
    code = singeCost('1001', 'Q303', 'MIHC', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q303')

    # if code == 1:
    #     sicbResult('Q303', p_day_1, p_day_2)
    # if code == 0:
    #     param_info = param_info + 'Q303_CODE=0,'
    code = singeCost('1001', 'Q418', 'MIDD', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q418')

    # if code == 1:
    #     sicbResult('Q418', p_day_1, p_day_2)
    # if code == 0:
    #     param_info = param_info + 'Q418_CODE=0,'
    code = singeCost('1001', 'Q164', 'MIDI', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q164')

    # if code == 1:
    #     sicbResult('Q164', p_day_1, p_day_2)
    # if code == 0:
    #     param_info = param_info + 'Q164_CODE=0,'
    code = singeCost('1001', 'Q171', 'MICF', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q171')

    # if code == 1:
    #     sicbResult('Q171', p_day_1, p_day_2)
    # if code == 0:
    #     param_info = param_info + 'Q171_CODE=0,'
    code = singeCost('1001', 'Q172', 'MIHG', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q172')

    # if code == 1:
    #     sicbResult('Q172', p_day_1, p_day_2)
    # if code == 0:
    #     param_info = param_info + 'Q172_CODE=0,'

    # 一期机组
    code = singeCost('1001', 'C302', 'MIAC', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('C302')

    # if code == 1:
    #     sicbResult('C302', p_day_1, p_day_2)
    # if code == 0:
    #     param_info = param_info + 'C302_CODE=0,'
    code = singeCost('1001', 'Q102', 'MIBA', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q102')

    # if code == 1:
    #     sicbResult('Q102', p_day_1, p_day_2)
    # if code == 0:
    #     param_info = param_info + 'Q102_CODE=0,'
    code = singeCost('1001', 'Q202', 'MIBB', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q202')

    # if code == 1:
    #     sicbResult('Q202', p_day_1, p_day_2)
    # if code == 0:
    #     param_info = param_info + 'Q202_CODE=0,'
    code = singeCost('1001', 'Q302', 'MIBC', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q302')

    # if code == 1:
    #     sicbResult('Q302', p_day_1, p_day_2)
    # if code == 0:
    #     param_info = param_info + 'Q302_CODE=0,'
    code = singeCost('1001', 'Q116', 'MIBF', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q116')

    # if code == 1:
    #     # sicbResult('Q116', p_day_1, p_day_2)
    # if code == 0:
    #     param_info = param_info + 'Q116_CODE=0,'
    code = singeCost('1001', 'Q216', 'MIBG', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q216')

    # if code == 1:
    #     # sicbResult('Q216', p_day_1, p_day_2)
    # if code == 0:
    #     param_info = param_info + 'Q216_CODE=0,'
    code = singeCost('1001', 'Q101', 'MIAB', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('Q101')

    # if code == 1:
    #     # sicbResult('Q101', p_day_1, p_day_2)
    # if code == 0:
    #     param_info = param_info + 'Q101_CODE=0,'
    code = singeCost('1001', 'H050', 'MIAA', p_day_2 + '200000', p_day_1 + '200000', 'D')
    print('H050')

    # if code == 1:
    #     # sicbResult('H050', p_day_1, p_day_2)
    # if code == 0:
    #     param_info = param_info + 'H050_CODE=0,'
    #
    # bzbzcb()
    # bzbzfy('1001', p_month)
    # bzcbjs('1001', 'MIDN', '', p_day_2 + '200000', p_day_1 + '200000', 'D')
    # bzcbjs('1001', 'MIDM', '', p_day_2 + '200000', p_day_1 + '200000', 'D')
    # bzcbjs('1001', 'MIDY', '', p_day_2 + '200000', p_day_1 + '200000', 'D')
    # bzcbjs('1001', 'MIDZ', '', p_day_2 + '200000', p_day_1 + '200000', 'D')
    #
    # bzcbjs('1001', 'MICX', '', p_day_2 + '200000', p_day_1 + '200000', 'D')
    # bzcbjs('1001', 'MIHY', '', p_day_2 + '200000', p_day_1 + '200000', 'D')
    # bzcbjs('1001', 'MIHZ', '', p_day_2 + '200000', p_day_1 + '200000', 'D')
    # bzcbjs('1001', 'MICZ', '', p_day_2 + '200000', p_day_1 + '200000', 'D')

    # bzsjcb_d('1001', p_day_1, 'D')

    param_info = param_info + 'end'
    # writelog('batchD.py', start, 'update', param_info)
    # elapsed = float((datetime.datetime.now() - start).seconds)
    # print("Time Used 4 All ----->>>> %f seconds" % (elapsed))

    sys.exit()


